<html>
  <head>
    <link type="text/css" rel="stylesheet" href="../../css/style.css"/>
    <title>CompositeIterator Pattern</title>
	<script type="text/javascript" src="MenuComponent.js"></script>
	<script type="text/javascript" src="Menu.js"></script>
	<script type="text/javascript" src="MenuItem.js"></script>
	<script type="text/javascript" src="Iterator.js"></script>
	<script type="text/javascript" src="CompositeIterator.js"></script>
	<script type="text/javascript" src="ConvertToIterator.js"></script>
	<script type="text/javascript" src="NullIterator.js"></script>
	<script type="text/javascript" src="DinnerMenu.js"></script>
	<script type="text/javascript" src="PancakeHouseMenu.js"></script>
	<script type="text/javascript" src="CafeMenu.js"></script>
	<script type="text/javascript" src="Mattress.js"></script>
  </head>
  <body>
    <div id="source">
      <h2>Source</h2>
      <pre>
var oPanCakeHouseMenu = new Menu("Pancake House Menu", "Breakfast");
var oDinnerMenu = new Menu("Dinner Menu", "Lunch");
var oCoffeeMenu = new Menu("Cafe Menu", "Dinner");
var oAllMenus = new Menu("ALL MENUS", "All menus combined");

oAllMenus.add(oPanCakeHouseMenu);
oAllMenus.add(oDinnerMenu);

oDinnerMenu.add(new MenuItem("Pasta", "Spaghetti with Marinara Sauce, and a slice of sourdough bread", true, 3.89));
oDinnerMenu.add(oCoffeeMenu);

oCoffeeMenu.add(new MenuItem("Express", "Coffee from machine", false, 0.99));

var oMattress = new Mattress(oAllMenus);
oMattress.printMenu();
      </pre>
    </div>
    <div id="console">
    	<h2>Console</h2>
	    <ul></ul>
	    <h1>COMPOSITE ITERATOR</h1>
    </div>
    <script type="text/javascript" src="../../js/utils.js"></script>
    <script type="text/javascript">
		var oPanCakeHouseMenu = new Menu("Pancake House Menu", "Breakfast");
		var oDinnerMenu = new Menu("Dinner Menu", "Lunch");
		var oCoffeeMenu = new Menu("Cafe Menu", "Dinner");
		var oAllMenus = new Menu("ALL MENUS", "All menus combined");

		oAllMenus.add(oPanCakeHouseMenu);
		oAllMenus.add(oDinnerMenu);

		oDinnerMenu.add(new MenuItem("Pasta",
										"Spaghetti with Marinara Sauce, and a slice of sourdough bread",
										true,
										3.89));
		oDinnerMenu.add(oCoffeeMenu);

		oCoffeeMenu.add(new MenuItem("Express", "Coffee from machine", false, 0.99));

		var oMattress = new Mattress(oAllMenus);
		console.log("---------------------------------------------");
		oMattress.printMenu();
		console.log("---------------------------------------------");
    </script>
  </body>
</html>
